<? include_once("../../../common/common_setting_unit.php"); //引入通用的设置文件?>


<?php

$plate=select_one_line_all_items($table_Prefix."plate", "mid = 'case'");
//设置需要搜索的表格的前缀后缀
 $table_suffix = "case";
 $table        = $table_Prefix . $table_suffix;
?>


<?
//用来判断当前系统属于什么板块
$system_part = $plate['mid'];
?>




<?php
//更新项目基本信息


$new_detail_nid          = addslashes($_REQUEST['nid']);


//在更新项目的资料之前，先计算一下利润。
$_profit=sum_total($table_Prefix."finance","cost"," status = '过账' and caseid='".$new_detail_nid."' ");

$_REQUEST['ai_profit']=$_profit;


//传递过来的页面信息。返回的时候，会根据这些信息返回原来的页面
$nowpageid = addslashes($_REQUEST['nowpageid']);
$sortby    = addslashes($_REQUEST['sortby']);
$term_nid  = addslashes($_REQUEST['term_nid']);
$navitemed = addslashes($_REQUEST['navitemed']);


$_REQUEST['ai_authur']      = $_SESSION['username'];
$_REQUEST['ai_utoken']      = $_SESSION['utoken'];


$sql=update_date($table,$_REQUEST,"nid",$new_detail_nid);
$query = mysql_query($sql) or die ("error:".mysql_error().$sql);

?>








<script type="text/javascript">
    alert("输入信息已保存，点击确认返回继续操作.");
    document.location.href = "detail-list.php?nowpageid=<? echo $_GET["nowpageid"] ?>&sortby=<? echo $sortby?>&nid=<? echo $term_nid ?>&sys_part=<? echo $system_part ?>&nav-itemed=<? echo $_GET["nav-itemed"] ?>"
</script>

